package kmi.droid.particles.sample;

import android.graphics.Matrix;
import android.graphics.Path;

public class SquareHelper
{
	public static Path getSquare(float cx, float cy, int width, int height,
			float angle)
	{
		Path path = new Path();

		path.addRect(-width / 2, -height / 2, width / 2, width / 2,
				Path.Direction.CW);

		Matrix matrix = new android.graphics.Matrix();
		matrix.setRotate(angle);

		path.transform(matrix);
		matrix.setTranslate(cx - width / 2, cy - height / 2);
		path.transform(matrix);

		return path;
	}
}
